<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">

	<ui:composition template="../template.xhtml">
		<ui:define name="conteudo">
			<p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>
			<p:dialog modal="true" widgetVar="statusDialog" header="Status"   
		        draggable="false" closable="false">  
			    <h:outputText value="Aguarde..." /> 
			</p:dialog>  
			<div id="location">Manter Perfil</div>
			<div id="container">
				<p:messages id="growl" showDetail="true" showSummary="false"/>
				<div id="form">
					<h:form id="perfilForm">
					<h:inputHidden value="#{perfilMB.perfil.id}" />
						<fieldset>
							<fieldset>
       						<legend>Dados</legend>
       						<table width="60%" align="left">
       							<tr>
       								<td>
										<label style="width: 200px;">
											<p>Nome:</p>
											<p:inputText value="#{perfilMB.perfil.nmPerfil}" required="true" requiredMessage="Nome é obrigatório."/>
										</label>
									</td>
								</tr>
							</table>
							</fieldset>
							<p:spacer height="20"/>
       							<div align="right" style="padding-right: 20px; padding-bottom: 10px;">
								<p:spacer width="10"/>
								<p:commandButton value="Salvar" action="#{perfilMB.saveOrUpdate}" update="growl"/>
								<p:spacer width="10"/>
								<p:commandButton value="Voltar" action="#{perfilMB.paginaBusca}" immediate="true" ajax="false"/>
							</div>
						</fieldset>
					</h:form>
				</div>
			</div>
		</ui:define>
	</ui:composition>
</html>